str1='ABCACDBEFD'
def func(str1):
    dic = {}
    for i in str1:
        dic[i]=dic.get(i,0)+1
    return dic
res=func(str1)
print(res)
dic={}
for i in str1:
    if i in dic:
        dic[i]+=1
    else:
        dic[i]=1
print(dic)


dic = {}
for i in str1:
    dic[i] = dic.get(i, 0)+1
print(dic)